<template>
  <div class="table-container pull-chheight">
    <avue-crud :option="tableOption" v-model="user" :data="tableData" :table-loading="tableLoading"
               @row-update="handleUpdate"
               :page="page"
               ref="crud"
               @refresh-change="handlerefreshChange" @current-change="handleCurrentChange"
               @search-change="handleSearchChange" @size-change="handleSizeChange"
               @selection-change="handleSelectionChange">
      <template slot-scope="scope" slot="wechat">
        <span>{{ scope.row.wechat}}</span>
      </template>
      <template slot-scope="scope" slot="tel1">
        <span>{{ scope.row.tel1}}</span>
      </template>
      <template slot-scope="scope" slot="tel2">
        <span>{{scope.row.tel2}}</span>
      </template>
      <template slot-scope="scope" slot="collectDate">
        <span>{{parseDate(scope.row.collectDate)}}</span>
      </template>
      <!--<template slot-scope="scope" slot="registerDate">-->
      <!--<span>{{parseDate(scope.row.registerDate)}}</span>-->
      <!--</template>-->
      <!--@row-dblclick="handleRowDBLClick" @row-click="handleRowClick" :before-close="boxhandleClose" :before-open="boxhandleOpen" @row-del="handleDel"   @row-save="handleSave"-->
      <template slot="menuRight">
        <el-button v-if="permissions.training_student_documents_add" type="primary" icon="el-icon-plus"
                   @click="handleAdd" circle size="small"></el-button>
        <el-button type="primary" icon="el-icon-edit" @click="handleRowEdit" circle size="small"></el-button>
        <!--<el-button type="danger" icon="el-icon-delete" circle size="small" @click="handleRowDel"></el-button>-->
        <!--<el-button type="info" icon="el-icon-tickets" @click="handleCalls" circle size="small"></el-button>-->
      </template>
      <template slot-scope="props" slot="expand">
        <el-form label-position="left" inline class="demo-table-expand">
          <el-form-item label="年龄">
            <span>：{{ props.row.age }}</span>
          </el-form-item>
          <el-form-item label="学员状态">
            <span>：{{ bizStatusS(props.row.bizStatus)}}</span>
          </el-form-item>
          <el-form-item label="身份证号">
            <span>：{{ props.row.idCard }}</span>
          </el-form-item>
          <el-form-item label="职位">
            <span>：{{ jobTypeS(props.row.jobType) }}</span>
          </el-form-item>
          <el-form-item label="行业类别">
            <span>：{{ workingTypeS(props.row.workingType) }}</span>
          </el-form-item>
          <el-form-item label="工作区域">
            <span>：{{ workingAreaS(props.row.workingArea) }}</span>
          </el-form-item>
          <el-form-item label="详细地址">
            <span>：{{ props.row.homeAddress }}</span>
          </el-form-item>
          <el-form-item label="居住区域">
            <span>：{{ homeareaS(props.row.homearea) }}</span>
          </el-form-item>
          <el-form-item label="校区">
            <span>：{{ schoolS(props.row.school) }}</span>
          </el-form-item>
          <el-form-item label="渠道来源">
            <span>：{{ channelS(props.row.channel) }}</span>
          </el-form-item>
          <el-form-item label="报名时间">
            <span>：{{ parseDate( props.row.lastFollowUpTime) }}</span>
          </el-form-item>
          <el-form-item label="跟进状态">
            <span>：{{ followUpStatusS(props.row.followUpStatus) }}</span>
          </el-form-item>
          <el-form-item label="跟进人">
            <span>：{{ userS(props.row.followUpUser) }}</span>
          </el-form-item>
          <el-form-item label="跟进次数">
            <span>：{{ props.row.callCount }}</span>
          </el-form-item>
          <el-form-item label="最后跟进时间">
            <span>：{{ parseDate(props.row.lastFollowUpTime)}}</span>
          </el-form-item>
          <el-form-item label="收集人 ">
            <span>：{{ userS(props.row.collectUser) }}</span>
          </el-form-item>
          <el-form-item label="收集时间">
            <span>：{{ parseDate( props.row.collectDate) }}</span>
          </el-form-item>
          <el-form-item label="创建人">
            <span>：{{ userS(props.row.createUser) }}</span>
          </el-form-item>
          <el-form-item label="创建时间">
            <span>：{{ parseDate( props.row.createTime) }}</span>
          </el-form-item>
          <el-form-item label="选择我们的原因">
            <span>：{{ choseReasonS(props.row.choseReason) }}</span>
          </el-form-item>
          <el-form-item label="认为我们的价格">
            <span>：{{ props.row.priceEvaluate }}</span>
          </el-form-item>
          <el-form-item label="前台接待满意度">
            <span>：{{ props.row.receptionEvaluate }}</span>
          </el-form-item>
          <el-form-item label="科目一通过时间">
            <span>：{{ parseDate( props.row.sub1FinishesDate) }}</span>
          </el-form-item>
          <el-form-item label="科目二通过时间">
            <span>：{{ parseDate( props.row.sub2FinishesDate) }}</span>
          </el-form-item>
          <el-form-item label="科目三通过时间">
            <span>：{{ parseDate( props.row.sub3FinishesDate) }}</span>
          </el-form-item>
          <el-form-item label="科目四通过时间">
            <span>：{{ parseDate( props.row.sub4FinishesDate) }}</span>
          </el-form-item>
        </el-form>
      </template>
      <template slot-scope="scope" slot="followUpUser">
        <el-tag>{{ userIdToName(scope.row.followUpUser) }}</el-tag>
      </template>
      <template slot-scope="scope" slot="collectUser">
        <el-tag>{{ userIdToName(scope.row.collectUser) }}</el-tag>
      </template>
      <template slot-scope="scope" slot="followUpUserForm">
        <el-cascader :options="users" v-model="defaultUser" @change="getNodeData"></el-cascader>
        <el-input type="hidden" v-model="user.followUpUser"></el-input>
      </template>
      <template v-if="training_student_documents_add_b || training_student_documents_add_t" slot-scope="scope"
                slot="menu">
        <!--<el-button v-if="scope.row.bizStatus== '2201'" type="primary" @click="submitForm('ruleForm2')">提交</el-button>-->

        <el-button :type="btnType(scope.row.bizStatus,true)" v-if="training_student_documents_add_b"
                   icon="el-icon-edit" size="small" plain @click.stop.safe="signUp(scope.row)"
                   :disabled="btnDisablled(scope.row.bizStatus,true)">报名
        </el-button>
        <el-button :type="btnType(scope.row.bizStatus,false)" v-if="training_student_documents_add_t"
                   icon="el-icon-edit" size="small" plain
                   @click.stop.safe="dropOutOfSchool(scope.row)" :disabled="btnDisablled(scope.row.bizStatus,false)">退学
        </el-button>
      </template>
    </avue-crud>

    <el-dialog title="报名表" :visible.sync="signUpForm">
      <el-form :model="ruleForm2" status-icon label-width="100px" :rules="rules2" ref="ruleForm2" class="demo-ruleForm"
               size="mini">
        <el-row :gutter="24" v-if="addInfo == 'add'">
          <el-col :span="11">
            <el-form-item label="姓名" prop="fname">
              <el-input type="text" v-model="ruleForm2.fname"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="年龄" prop="age">
              <el-input v-model.number="ruleForm2.age" disabled>
                <el-button slot="prepend">-</el-button>
                <el-button slot="append">+</el-button>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24" v-if="addInfo == 'add'">
          <el-col :span="11">
            <el-form-item label="性别" prop="sex">
              <template>
                <el-radio v-model="ruleForm2.sex" auto-complete="off" label="0">男</el-radio>
                <el-radio v-model="ruleForm2.sex" auto-complete="off" label="1">女</el-radio>
              </template>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="身份证号" prop="idCard">
              <el-input type="text" v-model="ruleForm2.idCard"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24" v-if="addInfo == 'add'">
          <el-col :span="11">
            <el-form-item label="手机号1" prop="tel1">
              <el-input type="text" v-model="ruleForm2.tel1"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="手机号2" prop="tel2">
              <el-input type="text" v-model="ruleForm2.tel2"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24" v-if="addInfo == 'add'">
          <el-col :span="11">
            <el-form-item label="微信" prop="wechat">
              <el-input type="text" v-model="ruleForm2.wechat"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="行业类别" prop="workingType">
              <el-select v-model="ruleForm2.workingType">
                <el-option v-for="item in workingTypeList" :key="item.value" :label="item.label"
                           :value="item.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24" v-if="addInfo == 'add'">
          <el-col :span="11">
            <el-form-item label="职位" prop="jobType">
              <el-select v-model="ruleForm2.jobType">
                <el-option v-for="item in jobTypeList" :key="item.value" :label="item.label"
                           :value="item.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="工作区域" prop="workingArea">
              <el-select v-model="ruleForm2.workingArea">
                <el-option v-for="item in workingAreaList" :key="item.value" :label="item.label"
                           :value="item.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24" v-if="addInfo == 'add'">
          <el-col :span="11">
            <el-form-item label="居住区域" prop="homeArea">
              <el-select v-model="ruleForm2.homeArea">
                <el-option v-for="item in homeAreaList" :key="item.value" :label="item.label"
                           :value="item.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="居住地址" prop="homeAddress">
              <el-input type="text" v-model="ruleForm2.homeAddress"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="登记人" prop="createUser">
              <el-select readonly="true" v-model="ruleForm2.createUser">
                <el-option
                  v-for="item in infoForm.createUser"
                  :key="item.userId"
                  :label="item.username"
                  :value="item.userId">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="预计入学日" prop="enrolmentDate">
              <el-date-picker type="date" placeholder="选择日期" v-model="ruleForm2.enrolmentDate"
                              style="width: 100%;"></el-date-picker>
            </el-form-item>
            <!--<el-form-item label="登记时间" prop="createTime">-->
            <!--<el-date-picker type="date" placeholder="选择日期" v-model="ruleForm2.createTime"-->
            <!--style="width: 100%;"></el-date-picker>-->
            <!--</el-form-item>-->
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="报名方式" prop="registerMode">
              <el-select v-model="ruleForm2.registerMode" filterable placeholder="请选择">
                <el-option
                  v-for="item in infoForm.registerMode"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="学费" prop="money">
              <el-input v-model="ruleForm2.money">
                <template slot="append">.00 元</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="支付方式" prop="payType">
              <el-select v-model="ruleForm2.payType" filterable placeholder="请选择">
                <el-option
                  v-for="item in infoForm.payType"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="是否已付款" prop="isPay">
              <template>
                <el-radio v-model="ruleForm2.isPay" auto-complete="off" label="1">是</el-radio>
                <el-radio v-model="ruleForm2.isPay" auto-complete="off" label="2">否</el-radio>
              </template>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="校区" prop="schoolArea">
              <el-select v-model="ruleForm2.schoolArea" filterable placeholder="请选择">
                <el-option
                  v-for="item in infoForm.schoolArea"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="班级类别" prop="classType">
              <el-select v-model="ruleForm2.classType" filterable placeholder="请选择">
                <el-option
                  v-for="item in infoForm.classType"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <!--<el-row :gutter="24">-->
        <!--<el-col :span="11">-->

        <!--</el-col>-->
        <!--</el-row>-->
        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="学车时段" prop="learnSameTime">
              <el-input type="text" v-model="ruleForm2.learnSameTime" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="跟进人" prop="followUpUser">
              <el-cascader :options="users" v-model="defaultUser" @change="getNodeData"></el-cascader>
              <input type="hidden" v-model="ruleForm2.followUpUser"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="22">
            <el-form-item label="备注" prop="remark">
              <el-input type="textarea" v-model="ruleForm2.remark" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-form-item>
            <el-col :span="5">
              <el-button v-if="addInfo == 'add'" type="primary" @click="submitAddForm('ruleForm2')">新增</el-button>
            </el-col>
            <el-col :span="5">
              <el-button v-if="addInfo == 'register'" type="primary" @click="submitForm('ruleForm2')">提交</el-button>
            </el-col>
            <el-col :span="5">
              <el-button @click="resetForm('ruleForm2')">重置</el-button>
            </el-col>
            <el-button @click="signUpForm = false">取消</el-button>
          </el-form-item>
        </el-row>
      </el-form>
    </el-dialog>

    <el-dialog title="退学表" :visible.sync="dropOutOfSchoolForm">
      <el-form :model="ruleForm3" status-icon label-width="100px" :rules="rules3" ref="ruleForm3" class="demo-ruleForm"
               size="mini">
        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="学员" prop="student_id">
              <el-input type="text" v-model="ruleForm3.student_id" readonly="true" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="退费金额" prop="money">
              <el-input v-model.number="ruleForm3.money">
                <template slot="append">.00 元</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="教练" prop="coachId">
              <el-cascader :options="users" v-model="defaultUser" @change="getNodeDataS"></el-cascader>
              <input type="hidden" v-model="ruleForm3.coachId"/>
            </el-form-item>
            <!--<el-form-item label="教练" prop="coachId">-->
            <!--<el-select v-model="ruleForm3.coachId" filterable placeholder="请选择">-->
            <!--&lt;!&ndash;<el-option&ndash;&gt;-->
            <!--&lt;!&ndash;v-for="item in infoForm.coachId"&ndash;&gt;-->
            <!--&lt;!&ndash;:key="item.value"&ndash;&gt;-->
            <!--&lt;!&ndash;:label="item.label"&ndash;&gt;-->
            <!--&lt;!&ndash;:value="item.value">&ndash;&gt;-->
            <!--&lt;!&ndash;</el-option>&ndash;&gt;-->
            <!--<el-cascader :options="users" v-model="defaultUser" @change="getNodeData"></el-cascader>-->
            <!--<input type="hidden" v-model="ruleForm2.coachId" />-->
            <!--</el-select>-->
            <!--</el-form-item>-->
          </el-col>
          <el-col :span="11">
            <el-form-item label="当前科目" prop="currentSubject">
              <el-select v-model="ruleForm3.currentSubject" filterable placeholder="请选择">
                <el-option
                  v-for="item in infoForm.trainingSubject"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <!--<el-row :gutter="24">-->
        <!--<el-col :span="11">-->
        <!--<el-form-item label="是否退费" prop="isReturnMoney">-->
        <!--<el-select v-model="ruleForm3.isReturnMoney" filterable placeholder="请选择">-->
        <!--<el-option-->
        <!--v-for="item in infoForm.isReturnMoney"-->
        <!--:key="item.value"-->
        <!--:label="item.label"-->
        <!--:value="item.value">-->
        <!--</el-option>-->
        <!--</el-select>-->
        <!--</el-form-item>-->
        <!--</el-col>-->
        <!--</el-row>-->
        <el-row :gutter="24">
          <el-col :span="22">
            <el-form-item label="退学原因" prop="outReason">
              <el-input type="text" v-model="ruleForm3.outReason" auto-complete="off"></el-input>
              <!--<el-date-picker v-model="ruleForm3.learnSameTime" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"></el-date-picker>-->
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="22">
            <el-form-item label="备注" prop="remark">
              <el-input type="textarea" v-model="ruleForm3.remark" auto-complete="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-form-item>
            <el-col :span="5">
              <el-button type="primary" @click="submitForm2('ruleForm3')">退学</el-button>
            </el-col>
            <el-col :span="5">
              <el-button @click="resetForm2('ruleForm3')">重置</el-button>
            </el-col>
            <el-button @click="dropOutOfSchoolForm = false">取消</el-button>
          </el-form-item>
        </el-row>
      </el-form>
    </el-dialog>

    <el-dialog title="编辑" :visible.sync="updForm">
      <el-form :model="ruleForm4" status-icon label-width="100px" :rules="rules4" ref="ruleForm4" class="demo-ruleForm"
               size="mini">
        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="姓名" prop="fname">
              <el-input type="text" v-model="ruleForm4.fname"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="年龄" prop="age">
              <el-input v-model.number="ruleForm4.age" disabled>
                <el-button slot="prepend">-</el-button>
                <el-button slot="append">+</el-button>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="性别" prop="sex">
              <template>
                <el-radio v-model="ruleForm4.sex" auto-complete="off" label="0">男</el-radio>
                <el-radio v-model="ruleForm4.sex" auto-complete="off" label="1">女</el-radio>
              </template>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="身份证号" prop="idCard">
              <el-input type="text" v-model="ruleForm4.idCard"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="手机号1" prop="tel1">
              <el-input type="text" v-model="ruleForm4.tel1"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="手机号2" prop="tel2">
              <el-input type="text" v-model="ruleForm4.tel2"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="微信" prop="wechat">
              <el-input type="text" v-model="ruleForm4.wechat"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="行业类别" prop="workingType">
              <el-select v-model="ruleForm4.workingType">
                <el-option v-for="item in workingTypeList" :key="item.value" :label="item.label"
                           :value="item.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="职位" prop="jobType">
              <el-select v-model="ruleForm4.jobType">
                <el-option v-for="item in jobTypeList" :key="item.value" :label="item.label"
                           :value="item.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="工作区域" prop="workingArea">
              <el-select v-model="ruleForm4.workingArea">
                <el-option v-for="item in workingAreaList" :key="item.value" :label="item.label"
                           :value="item.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="11">
            <el-form-item label="居住区域" prop="homeArea">
              <el-select v-model="ruleForm4.homeArea">
                <el-option v-for="item in homeAreaList" :key="item.value" :label="item.label"
                           :value="item.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="居住地址" prop="homeAddress">
              <el-input type="text" v-model="ruleForm4.homeAddress"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-form-item>
            <el-col :span="5">
              <el-button type="primary" @click="submitUpdForm('ruleForm4')">提交</el-button>
            </el-col>
            <el-col :span="5">
              <el-button @click="resetForm('ruleForm4')">重置</el-button>
            </el-col>
            <el-button @click="updForm = false">取消</el-button>
          </el-form-item>
        </el-row>
      </el-form>
    </el-dialog>

  </div>
</template>

<script>
  import {mapGetters} from 'vuex'
  import {putObj, checkInformation} from '@/api/training/training_student'
  import tabOption from '@/const/training/training_student_documents'
  import {fetchList} from '@/api/training/training_student_documents'
  import {validatenull} from '@/util/validate'
  import { findParent2, formatDateS} from '@/util/util.js'
  import {getDeptUserTree, getIdName, getIdNameList} from '@/api/user'
  import {loadByType} from '@/api/dict'
  import {remote} from '@/api/dict'
  import { signUp } from '@/api/training/training_student_register'
  import {signUpDocuments, dropOutOfSchool} from '@/api/training/training_student_documents'
  import waves from '@/directive/waves/index.js' // 水波纹指令
  export default {
    name: 'table_intention_customer',
    directives: {
      waves
    },
    data() {
      var checkAge = (rule, value, callback) => {
        if (!value) {
          return callback(new Error('年龄不能为空'))
        }
        setTimeout(() => {
          if (!Number.isInteger(value)) {
            callback(new Error('请输入数字值'))
          } else {
            if (value < 18 || value > 70) {
              callback(new Error('必须在18~70岁之间'))
            } else {
              callback()
            }
          }
        })
      }
      var netEmptyDate = (rule, value, callback) => {
        if (!value) {
          return callback(new Error('请填写时间'))
        } else {
          return callback()
        }
      }
      var isInt = (rule, value, callback) => {
        if (!value) {
          return callback(new Error('请输入数字值'))
        }
        if (value != ((value - 1) + 1)) {
          return callback(new Error('请输入正确的数字值'))
        } else {
          return callback()
        }
      }
      var isCard = (rule, value, callback) => {
        value += ''
        if (!(value.length === 15 || value.length === 18)) {
          return callback(new Error('请输入15或18位身份证号'))
        } else if (!(((value.substr(0, value.length - 1) - 1) + 1) === (value.substr(0, value.length - 1) - 0))) {
          return callback(new Error('请输入正确的身份证号'))
        } else {
          var age = 0
          if (value.length === 15) {
            if (!(((value.substr(0, value.length) - 1) + 1) === (value.substr(0, value.length) - 0))) {
              return callback(new Error('请输入正确的身份证号'))
            }
            age = this.ageData('19' + value.substr(6, 6))
          } else {
            age = this.ageData(value.substr(6, 8))
          }
          if (!Number(age)) {
            return callback(new Error('请输入正确的身份证号'))
          } else {
            this.ruleForm2.age = age
            this.ruleForm4.age = age
          }
        }
        return callback()
      }
      return {
        page: {
          total: 0, // 总页数
          currentPage: 1, // 当前页数
          pageSize: 10 // 每页显示多少条
        },
        pickerOptions2: {
          shortcuts: [{
            text: '最近一周',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
              picker.$emit('pick', [start, end])
            }
          }, {
            text: '最近一个月',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
              picker.$emit('pick', [start, end])
            }
          }, {
            text: '最近三个月',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
              picker.$emit('pick', [start, end])
            }
          }]
        },
        ruleForm2: {
          fname: '',
          tel1: '',
          followUpUser: '',
          tel2: '',
          age: 0,
          sex: '1',
          idCard: '',
          coachId: '',
          wechat: '',
          workingType: '',
          jobType: '',
          workingArea: '',
          homeArea: '',
          homeAddress: '',
          createUser: '',
          registerMode: '',
          money: '',
          payType: '',
          isPay: '2',
          schoolArea: '',
          classType: '',
          learnSameTime: '',
          enrolmentDate: '',
          remark: ''
        },
        dialogStatus: '',
        rules2: {
          createUser: [{required: true, message: '请选择活动资源', trigger: 'change'}],
          fname: [{required: true, message: '请输入姓名', trigger: 'blur'}],
          tel1: [{required: true, message: '请输入手机号', trigger: 'blur'}, {validator: isInt, trigger: 'blur'}, {
            min: 0,
            max: 11,
            message: '请输入正确的手机号',
            trigger: 'blur'
          }],
          tel2: [{min: 0, max: 11, message: '请输入正确的手机号', trigger: 'blur'}],
          idCard: [{required: true, message: '请填写信息', trigger: 'blur'}, {validator: isCard, trigger: 'blur'}],
          age: [{validator: checkAge, trigger: 'change'}],
          registerMode: [{required: true, message: '请选择活动资源', trigger: 'change'}],
          money: [{required: true, message: '请输入金额', trigger: 'blur'}, {validator: isInt, trigger: 'blur'}],
          payType: [{required: true, message: '请选择活动资源', trigger: 'change'}],
          isPay: [{validator: null, trigger: 'blur'}],
          schoolArea: [{required: true, message: '请选择活动资源', trigger: 'change'}],
          classType: [{required: true, message: '请选择活动资源', trigger: 'change'}],
          followUpUser: [{required: true, message: '请选择活动资源', trigger: 'change'}],
          learnSameTime: [{required: true, message: '请填写信息', trigger: 'blur'},
            {min: null, max: 30, message: '长度在 30 个字符以内', trigger: 'blur'}],
          enrolmentDate: [{required: true, message: '请填写如入学日期', trigger: 'blur'}, {
            validator: netEmptyDate,
            trigger: 'blur'
          }],
          remark: [{validator: null, trigger: 'blur'}]
        },
        ruleForm3: {
          student_id: '',
          currentSubject: '',
          coachId: '',
          outReason: '',
          isReturnMoney: '0',
          money: '',
          remark: '',
          bizStatus: '',
          createTime: '',
          createUser: '',
          updateTime: '',
          updateUser: '',
          delFlag: ''
        },
        rules3: {
          studentId: [{required: true, message: '请选择活动资源', trigger: 'change'}],
          currentSubject: [{required: true, message: '请选择活动资源', trigger: 'change'}],
          coachId: [{required: true, message: '请选择活动资源', trigger: 'change'}],
          outReason: [{required: true, message: '请填写信息', trigger: 'change'}],
          isReturnMoney: [{required: true, message: '请选择活动资源', trigger: 'change'}],
          money: [{validator: isInt, trigger: 'blur'}],
          remark: [{validator: null, trigger: 'blur'}]
        },
        ruleForm4: {},
        rules4: {
          fname: [{required: true, message: '请输入姓名', trigger: 'blur'}],
          tel1: [{required: true, message: '请输入手机号', trigger: 'blur'}, {validator: isInt, trigger: 'blur'},
            {min: 0, max: 11, message: '请输入正确的手机号', trigger: 'blur'}],
          tel2: [{min: 0, max: 11, message: '请输入正确的手机号', trigger: 'blur'}],
          idCard: [{required: true, message: '请填写信息', trigger: 'blur'}, {validator: isCard, trigger: 'blur'}],
          age: [{validator: checkAge, trigger: 'change'}]
        },
        infoForm: {
          payType: [], // 支付方式
          registerMode: [], // 报名方式
          schoolArea: [], // 校区
          classType: [], // 班级类别
          createUser: [],
          isReturnMoney: [{'label': '否', 'value': 0}, {'label': '是', 'value': 1}],
          trainingSubject: [], // 科目
          coachId: [] // 教练
        },
        dropOutOfSchoolForm: false,
        signUpForm: false,
        updForm: false,
        tableSearch: {},
        tableOption: tabOption,
        tableData: [],
        tableRow: {},
        tableLoading: false,
        user: {},
        users: [],
        delFlag: 0,
        studentId: 0,
        updateTime: new Date().toLocaleDateString(),
        defaultUser: [],
        addInfo: '',
        workingTypeList: [],
        jobTypeList: [],
        workingAreaList: [],
        homeAreaList: [],
        infoTabel: {
          channel: [],
          bizStatus: [],
          jobType: [],
          workingType: [],
          workingArea: [],
          homearea: [],
          school: [],
          followUpStatus: [],
          followUpUserA: [],
          createUser: [],
          collectUser: [],
          choseReason: [],
          user: []
        }
      }
    },
    created() {
      this.handleList()
      this.initUserDic()
      this.training_student_documents_add_b = this.permissions['training_student_documents_add_b']
      this.training_student_documents_add_t = this.permissions['training_student_documents_add_t']
    },
    watch: {},
    mounted() {
      this.infoSelect()
      this.infoTabelS()
    },
    computed: {
      ...mapGetters(['permissions', 'menuAll'])
    },
    props: [],
    methods: {
      ageData(value) {
        var beginDate = new Date(value.substr(0, 4) + '-' + value.substr(4, 2) + '-' + value.substr(6, 2)).getTime()
        var newDate = new Date(new Date().getTime() - beginDate) + ''
        return this.parseDate(newDate).substr(0, 4) - 1970
      },
      btnDisablled(status, type) {
        if (type) {
          if (!(status === '2201' || status === null)) {
            return true
          }
        } else {
          if (status === null || status === '2201' || status === '2207' || status === '2208') {
            return true
          }
        }
      },
      btnType(status, type) {
        if (type) {
          if (!(status === '2201' || status === null)) {
            return 'info'
          } else {
            return 'success'
          }
        } else {
          if (status === null || status === '2201' || status === '2207' || status === '2208') {
            return 'info'
          } else {
            return 'warning'
          }
        }
      },
      infoTabelS() {
        getIdNameList().then(response => {
          for (let i = 0; i < response.data.length; i++) {
            this.infoTabel.createUser[i] = {0: response.data[i].username, 1: response.data[i].userId}
            this.infoTabel.user[i] = {0: response.data[i].username, 1: response.data[i].userId}
          }
        })
        loadByType('channel_source').then(response => {
          for (let i = 0; i < response.data.length; i++) {
            this.infoTabel.channel[i] = {0: response.data[i].label, 1: response.data[i].value}
          }
        })
        loadByType('student_status').then(response => {
          for (let i = 0; i < response.data.length; i++) {
            this.infoTabel.bizStatus[i] = {0: response.data[i].label, 1: response.data[i].value}
          }
        })
        loadByType('job_type').then(response => {
          for (let i = 0; i < response.data.length; i++) {
            this.infoTabel.jobType[i] = {0: response.data[i].label, 1: response.data[i].value}
          }
        })
        loadByType('working_area').then(response => {
          for (let i = 0; i < response.data.length; i++) {
            this.infoTabel.workingArea[i] = {0: response.data[i].label, 1: response.data[i].value}
          }
        })
        loadByType('follow_up').then(response => {
          for (let i = 0; i < response.data.length; i++) {
            this.infoTabel.followUpStatus[i] = {0: response.data[i].label, 1: response.data[i].value}
          }
        })
        loadByType('chose_reason').then(response => {
          for (let i = 0; i < response.data.length; i++) {
            this.infoTabel.choseReason[i] = {0: response.data[i].label, 1: response.data[i].value}
          }
        })
        remote('industry_type').then(response => {
          this.workingTypeList = response.data
        })
        remote('job_type').then(response => {
          this.jobTypeList = response.data
        })
        remote('working_area').then(response => {
          this.workingAreaList = response.data
          this.homeAreaList = response.data
        })
      },
      bizStatusS(value) {
        if (value === null) {
          return this.infoTabel.bizStatus[0][0]
        }
        for (let i = 0; i < this.infoTabel.bizStatus.length; i++) {
          if (this.infoTabel.bizStatus[i][1] === value) {
            return this.infoTabel.bizStatus[i][0]
          }
        }
      },
      workingTypeS(value) {
        for (let i = 0; i < this.infoTabel.workingType.length; i++) {
          if (this.infoTabel.workingType[i][1] === value) {
            return this.infoTabel.workingType[i][0]
          }
        }
      },
      jobTypeS(value) {
        for (let i = 0; i < this.infoTabel.jobType.length; i++) {
          if (this.infoTabel.jobType[i][1] === value) {
            return this.infoTabel.jobType[i][0]
          }
        }
      },
      workingAreaS(value) {
        for (let i = 0; i < this.infoTabel.workingArea.length; i++) {
          if (this.infoTabel.workingArea[i][1] === value) {
            return this.infoTabel.workingArea[i][0]
          }
        }
      },
      homeareaS(value) {
        for (let i = 0; i < this.infoTabel.homearea.length; i++) {
          if (this.infoTabel.homearea[i][1] === value) {
            return this.infoTabel.homearea[i][0]
          }
        }
      },
      schoolS(value) {
        for (let i = 0; i < this.infoTabel.school.length; i++) {
          if (this.infoTabel.school[i][1] === value) {
            return this.infoTabel.school[i][0]
          }
        }
      },
      channelS(value) {
        for (let i = 0; i < this.infoTabel.channel.length; i++) {
          if (this.infoTabel.channel[i][1] === value) {
            return this.infoTabel.channel[i][0]
          }
        }
      },
      followUpStatusS(value) {
        for (let i = 0; i < this.infoTabel.followUpStatus.length; i++) {
          if (this.infoTabel.followUpStatus[i][1] === value) {
            return this.infoTabel.followUpStatus[i][0]
          }
        }
      },
      userS(value) {
        for (let i = 0; i < this.infoTabel.user.length; i++) {
          if (this.infoTabel.user[i][1] === value) {
            return this.infoTabel.user[i][0]
          }
        }
      },
      choseReasonS(value) {
        for (let i = 0; i < this.infoTabel.choseReason.length; i++) {
          if (this.infoTabel.choseReason[i][1] === value) {
            return this.infoTabel.choseReason[i][0]
          }
        }
      },
      parseDate(date) {
        if (date === null) {
          return '-'
        } else {
          return formatDateS(new Date(date), 'yyyy-MM-dd hh:mm:ss')
        }
      },
      infoSelect() {
        loadByType('register_mode').then(response => {
          this.infoForm.registerMode = response.data
        })
        loadByType('class_type').then(response => {
          this.infoForm.classType = response.data
        })
        loadByType('pa_type').then(response => {
          this.infoForm.payType = response.data
        })
        loadByType('school_area').then(response => {
          this.infoForm.schoolArea = response.data
          this.infoTabel.school = response.data
        })
        getIdName().then(response => {
          this.infoForm.createUser.push(response.data)
        })
        loadByType('training_subject').then(response => {
          this.infoForm.trainingSubject = response.data
        })
        getIdNameList().then(response => {
          for (let i = 0; i < response.data.length; i++) {
            this.infoForm.coachId[i] = {'label': response.data[i].username, 'value': response.data[i].userId}
            this.infoTabel.user[i] = {'label': response.data[i].username, 'value': response.data[i].userId}
          }
        })
      },
      submitAddForm(formName) {
        this.$refs[formName].validate((valid) => {
          var flag = true
          if (valid) {
            var value = this.ruleForm2.tel1
            checkInformation(value).then(response => {
              if (!response.data.data) {
                this.$notify({
                  title: '提示',
                  message: '手机号1已存在 ！',
                  type: 'warning',
                  duration: 2000
                })
                flag = false
              } else {
                value = this.ruleForm2.tel2
                checkInformation(value).then(response => {
                  if (this.ruleForm2.tel2.trim() !== '') {
                    if (!response.data.data) {
                      this.$notify({
                        title: '提示',
                        message: '手机号2已存在 ！',
                        type: 'warning',
                        duration: 2000
                      })
                      flag = false
                    } else {
                      value = this.ruleForm2.idCard
                      checkInformation(value).then(response => {
                        if (!response.data.data) {
                          this.$notify({
                            title: '提示',
                            message: '身份证号已存在 ！',
                            type: 'warning',
                            duration: 2000
                          })
                          flag = false
                        } else {
                          if (flag) {
                            signUp(this.ruleForm2).then(() => {
                              this.signUpForm = false
                              this.handleList()
                              this.$notify({
                                title: '成功',
                                message: '新增成功 ！',
                                type: 'success',
                                duration: 2000
                              })
                            })
                          }
                        }
                      })
                    }
                  } else {
                    value = this.ruleForm2.idCard
                    checkInformation(value).then(response => {
                      if (!response.data.data) {
                        this.$notify({
                          title: '提示',
                          message: '身份证号已存在 ！',
                          type: 'warning',
                          duration: 2000
                        })
                        flag = false
                      } else {
                        if (flag) {
                          signUp(this.ruleForm2).then(response => {
                            this.signUpForm = false
                            this.handleList()
                            this.$notify({
                              title: '成功',
                              message: '新增成功 ！',
                              type: 'success',
                              duration: 2000
                            })
                          })
                        }
                      }
                    })
                  }
                })
              }
            })
          }
        })
      },
      submitUpdForm(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            formName = this.ruleForm4
            var flag = true
            if ((formName.idCard !== null || formName.idCard.trim() !== '') && (formName.idCard.length > 18 || formName.idCard.length < 15)) {
              this.$notify({
                title: '提示',
                message: '请输入15-18身份证号!:',
                type: 'warning',
                duration: 2000
              })
            } else {
              var value = formName.tel1
              checkInformation(value).then(response => {
                if (!response.data.data && (response.data.msg - 0) !== formName.fid) {
                  this.$notify({
                    title: '提示',
                    message: '手机号1已存在 ！',
                    type: 'warning',
                    duration: 2000
                  })
                  flag = false
                } else {
                  value = formName.tel2
                  checkInformation(value).then(response => {
                    if (formName.tel2.trim() !== '') {
                      if (!response.data.data && (response.data.msg - 0) !== formName.fid) {
                        this.$notify({
                          title: '提示',
                          message: '手机号2已存在 ！',
                          type: 'warning',
                          duration: 2000
                        })
                        flag = false
                      } else {
                        value = formName.idCard
                        checkInformation(value).then(response => {
                          if (!response.data.data && (response.data.msg - 0) !== formName.fid) {
                            this.$notify({
                              title: '提示',
                              message: '身份证号已存在 ！',
                              type: 'warning',
                              duration: 2000
                            })
                            flag = false
                          } else {
                            if (flag) {
                              putObj(formName).then(data => {
                                this.$message({
                                  showClose: true,
                                  message: '修改成功',
                                  type: 'success'
                                })
                                this.updForm = false
                                this.ruleForm4 = ''
                                this.handleList()
                              })
                            }
                          }
                        })
                      }
                    } else {
                      value = formName.idCard
                      checkInformation(value).then(response => {
                        if (!response.data.data && (response.data.msg - 0) !== formName.fid) {
                          this.$notify({
                            title: '提示',
                            message: '身份证号已存在 ！',
                            type: 'warning',
                            duration: 2000
                          })
                          flag = false
                        } else {
                          if (flag) {
                            putObj(formName).then(data => {
                              this.$message({
                                showClose: true,
                                message: '修改成功',
                                type: 'success'
                              })
                              this.updForm = false
                              this.ruleForm4 = ''
                              this.handleList()
                            })
                          }
                        }
                      })
                    }
                  })
                }
              })
            }
          }
        })
      },
      submitForm(formName) {
        this.ruleForm2.fid = this.ruleForm2.followUpUser
        this.$refs[formName].validate((valid) => {
          if (valid) {
            this.ruleForm2.studentId = this.studentId
            signUpDocuments(this.ruleForm2).then(response => {
              if (response.data.data) {
                this.$message({
                  showClose: true,
                  message: '学员报名成功!',
                  type: 'success'
                })
                this.handleList()
                this.$refs[formName].resetFields()
                this.signUpForm = false
              } else {
                this.$message.error('学员报名失败!')
              }
            })
          } else {
            this.$notify({
              showClose: true,
              message: '请填写完整的报名表',
              type: 'error'
            })
          }
        })
      },
      resetForm(formName) {
        this.$refs[formName].resetFields()
        this.defaultUser = []
      },
      submitForm2(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            this.ruleForm3.studentId = this.studentId
            dropOutOfSchool(this.ruleForm3).then(response => {
              if (response.data.data) {
                this.$message({
                  showClose: true,
                  message: '学员退学成功!',
                  type: 'success'
                })
                this.$refs[formName].resetFields()
                this.dropOutOfSchoolForm = false
              } else {
                this.$message.error('学员退学失败!')
              }
            })
          } else {
            this.$notify({
              showClose: true,
              message: '请填写完整的退学表',
              type: 'error'
            })
          }
        })
      },
      resetForm2(formName) {
        this.$refs[formName].resetFields()
        this.defaultUser = []
      },
      initUserDic() {
        getDeptUserTree().then(response => {
          this.users = response.data
        })
      },
      getNodeData(data) {
        this.ruleForm2.followUpUser = data[data.length - 1]
      },
      getNodeDataS(data) {
        this.ruleForm3.coachId = data[data.length - 1]
      },
      userIdToName(userId) {
        return findParent2(this.users, userId)
      },
      /**
       * @title 刷新数据
       *
       **/
      handlerefreshChange(page) {
        this.handleList(this.tableSearch)
        this.$notify({
          message: `刷新数据成功`,
          type: 'success'
        })
      },
      handleRowEdit() {
        if (validatenull(this.tableRow)) {
          this.$notify({
            showClose: true,
            message: '请选择一行要编辑的数据',
            type: 'error'
          })
          return false
        } else if (this.tableRow.length > 1) {
          this.$notify({
            showClose: true,
            message: '请选择一行数据，不要选择多行',
            type: 'error'
          })
          return false
        }
        this.handleEdit(this.tableRow[0], -1)
      },
      handleEdit(row, index) {
        this.updForm = true
        this.ruleForm4 = row
        this.ruleForm4.sex = row.sex + ''
      },
      /**
       * @title 翻页
       *
       **/
      handleCurrentChange(val) {
        this.page.currentPage = val
        this.handleList()
      },
      /**
       * @title 改变每页显示条数
       *
       **/
      handleSizeChange(val) {
        this.page.pageSize = val
        this.handleList()
      },
      /**
       * @title 搜索按钮回掉
       *
       **/
      handleSearchChange(form) {
        this.tableSearch = form
        this.handleList(this.tableSearch)
      },
      /**
       * @title 打开新增窗口
       * @detail 调用crud的handleadd方法即可
       *
       **/
      handleAdd() {
        // this.$refs.crud.rowAdd()
        this.signUpForm = true
        this.addInfo = 'add'
        // remote('working_area').then(response => {
        //   this.homeAreaList = response.data
        // })
      },
      /**
       * @title 选中第几行
       * @param row 选中那几行数据
       * @detail 调用crud的toggleSelection方法即可
       *
       **/
      // toggleSelection(row) {
      //   this.$refs.crud.toggleSelection(row)
      // },
      /**
       * @title 获取数据
       * @detail 赋值为tableData表格即可
       *
       **/
      handleList() {
        this.tableLoading = true
        var queryParams = {
          'fname': this.tableSearch.fname,
          'intention_level': this.tableSearch.intentionLevel,
          'follow_up_user': this.tableSearch.followUpUser
        }
        var params = Object.assign({page: this.page.currentPage, limit: this.page.pageSize}, queryParams)
        fetchList(params).then(response => {
          this.tableData = response.data.records
          this.page.total = response.data.total
          this.tableLoading = false
        })
      },
      /**
       * @title 当前选中的数据
       * @param val 选中的值
       *
       **/
      handleSelectionChange(val) {
        this.tableRow = val
      },
      handleRowDel() {
        if (validatenull(this.tableRow)) {
          this.$notify({
            showClose: true,
            message: '请选择一行要删除的数据',
            type: 'error'
          })
          return false
        } else if (this.tableRow.length > 1) {
          this.$notify({
            showClose: true,
            message: '请选择一行数据，不要选择多行',
            type: 'error'
          })
          return false
        }
        this.handleDel(this.tableRow[0], -1)
      },
      /**
       * @title 数据更新
       * @param row 为当前的数据
       * @param index 为当前更新数据的行数
       * @param done 为表单关闭函数
       *
       **/
      handleUpdate(formName, index, done) {
        var flag = true
        if ((formName.idCard !== null || formName.idCard.trim() !== '') && (formName.idCard.length > 18 || formName.idCard.length < 15)) {
          this.$notify({
            title: '提示',
            message: '请输入15-18身份证号!:',
            type: 'warning',
            duration: 2000
          })
        } else {
          // if (flag) {
          var value = formName.tel1
          checkInformation(value).then(response => {
            if (!response.data.data && (response.data.msg - 0) !== formName.fid) {
              this.$notify({
                title: '提示',
                message: '手机号1已存在 ！',
                type: 'warning',
                duration: 2000
              })
              flag = false
            } else {
              value = formName.tel2
              checkInformation(value).then(response => {
                if (formName.tel2.trim() !== '') {
                  if (!response.data.data && (response.data.msg - 0) !== formName.fid) {
                    this.$notify({
                      title: '提示',
                      message: '手机号2已存在 ！',
                      type: 'warning',
                      duration: 2000
                    })
                    flag = false
                  } else {
                    value = formName.idCard
                    checkInformation(value).then(response => {
                      if (!response.data.data && (response.data.msg - 0) !== formName.fid) {
                        this.$notify({
                          title: '提示',
                          message: '身份证号已存在 ！',
                          type: 'warning',
                          duration: 2000
                        })
                        flag = false
                      } else {
                        if (flag) {
                          putObj(formName).then(data => {
                            this.tableData.splice(index, 1, Object.assign({}, formName))
                            this.$message({
                              showClose: true,
                              message: '修改成功',
                              type: 'success'
                            })
                            done()
                          })
                        }
                      }
                    })
                  }
                } else {
                  value = formName.idCard
                  checkInformation(value).then(response => {
                    if (!response.data.data && (response.data.msg - 0) !== formName.fid) {
                      this.$notify({
                        title: '提示',
                        message: '身份证号已存在 ！',
                        type: 'warning',
                        duration: 2000
                      })
                      flag = false
                    } else {
                      if (flag) {
                        putObj(formName).then(data => {
                          this.tableData.splice(index, 1, Object.assign({}, formName))
                          this.$message({
                            showClose: true,
                            message: '修改成功',
                            type: 'success'
                          })
                          done()
                        })
                      }
                    }
                  })
                }
              })
            }
          })
        }
      },
      handleCalls() {
      },
      signUp(row) {
        if (row.bizStatus === '2201') {
          this.studentId = row.fid
          this.signUpForm = true
          this.addInfo = 'register'
        } else {
          if (row.bizStatus == null) {
            this.studentId = row.fid
            this.signUpForm = true
            this.addInfo = 'register'
          } else {
            this.$notify({
              showClose: true,
              message: '该学员已报名!'
            })
          }
        }
      },
      dropOutOfSchool(row) {
        if (row.bizStatus === '2201') {
          this.$notify({
            showClose: true,
            message: '该学员状态无法执行该操作!',
            type: 'error'
          })
          return false
        } else {
          if (row.bizStatus === '2207') {
            this.$notify({
              showClose: true,
              message: '该学员状态无法执行该操作!',
              type: 'error'
            })
            return false
          } else {
            if (row.bizStatus === '2208') {
              this.$notify({
                showClose: true,
                message: '该学员状态无法执行该操作!',
                type: 'error'
              })
              return false
            } else {
              if (row.bizStatus == null) {
                this.$notify({
                  showClose: true,
                  message: '该学员状态无法执行该操作!',
                  type: 'error'
                })
                return false
              } else {
                this.ruleForm3.student_id = row.fname
                this.studentId = row.fid
                this.dropOutOfSchoolForm = true
              }
            }
          }
        }
      }
    }
  }
</script>

<style lang="scss" scoped>
  .table-container {
    padding: 8px 10px;
  }

  .table-header {
    margin-bottom: 10px;
    & > .el-button {
      padding: 12px 25px;
    }
  }

  .demo-table-expand {
    font-size: 0;
  }

  .demo-table-expand label {
    width: 90px;
    color: #99a9bf;
  }

  .demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 50%;
  }
</style>
